﻿using Smile.Mvvm.Mediator;
using Smile.Mvvm.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Smile.Mvvm.ViewModel
{
    public abstract partial class ViewModelLocatorBase : IViewModelLocator
    {
        // @Public
        public void Initialize()
        {
            InitializeServicesBase();
            InitializeServices();
            InitializeViewModels();
        }

        // @Protected
        protected abstract void InitializeServices();
        protected abstract void InitializeViewModels();

        // @Private
        void InitializeServicesBase()
        {
            ServiceLocator.Register<IMessengerService>(new Messenger());
            ServiceLocator.Register<IMessageBoxService>(new MessageBoxService());
            ServiceLocator.Register<INavigationService>(new NavService());
            ServiceLocator.Register<ISettingsService>(new SettingsService());
            ServiceLocator.Register<IShareService>(new ShareService());
            ServiceLocator.Register<IMediaStorageService>(new MediaStorageService());
            ServiceLocator.Register<ILockScreenService>(new LockScreenService());
            ServiceLocator.Register<IAppInfoService>(new AppInfoService());
        }
    }
}
